package telco.provider;

import java.util.HashMap;
import java.util.Collection;

import swa2012.telco.broker.beans.Message;

public class MessageStorage {

	private final HashMap<String,Collection<Message>> messageStorage = new HashMap<String, Collection<Message>>();
	
	public void addMessage(Message msg)
	{
		String clientID=msg.getReceiver().getID();
		if(messageStorage.containsKey(clientID)) 
			messageStorage.get(clientID).add(msg);
	}

	public Collection<Message> getMessages(String clientID) {
		if(messageStorage.containsKey(clientID))
			return messageStorage.get(clientID);
		return null;
	}
}
